package com.quartz.service.impl;

import com.quartz.service.BaseJob;
import org.quartz.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Date;

/**
 * @description:
 * @author: zyj
 * @create: 2020-01-02 10:57
 **/
@PersistJobDataAfterExecution
@DisallowConcurrentExecution
public class HelloJob implements BaseJob {
    private static Logger log = LoggerFactory.getLogger(HelloJob.class);

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        JobDataMap data = jobExecutionContext.getTrigger().getJobDataMap();//传递的参数

        log.info("Hello Job执行时间:"+new Date()+";;参数"+data.get("invokeParam"));
    }
}
